﻿
using System;
using System.Collections;
using System.Threading;
namespace HBase {
    /**
   *┌────────────────────────────────────────────────┐
   *│　描    述：MyConsole                                                    
   *│　作    者：sgj                                              
   *│　版    本：1.0                                              
   *│　创建时间：2021/3/28 10:26:06                        
   *└────────────────────────────────────────────────┘
   **/
    public class MyConsole {
        static public String[]  q = new string[1000];
        static int WriteIndex = 0;

        static int readIndex = 0;
        public static void addMessage(String message) {
            if( !LoggerCommon.loggerMyConsole ) {
                return;
            }

            q[WriteIndex++]=message;
            if (WriteIndex >= 1000) {
                WriteIndex = 0;
            }
            
        }

        public static String getOne() {
            if (readIndex >= 1000) {
                readIndex = 0;
            }
            if (WriteIndex == readIndex) {
                return null;
            }
            return  "["+WriteIndex+"=>"+readIndex+"]:"+ q[readIndex++];
        }


        
    }
}
